package com.tinysand.advert.search.vo;

import com.tinysand.advert.search.feature.DistrictFeature;
import com.tinysand.advert.search.feature.FeatureRelation;
import com.tinysand.advert.search.feature.InterestFeature;
import com.tinysand.advert.search.feature.KeywordFeature;
import com.tinysand.advert.search.media.AdSlot;
import com.tinysand.advert.search.media.App;
import com.tinysand.advert.search.media.Device;
import com.tinysand.advert.search.media.Geo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author TINY
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SearchRequest {
    // 媒体请求标识
    private String mediaId;

    // 请求的基本信息
    private RequestInfo requestInfo;

    // 匹配条件信息
    private FeatureInfo featureInfo;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class RequestInfo {
        private String requestId;
        private List<AdSlot> adSlots;
        private App app;
        private Geo geo;
        private Device device;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class FeatureInfo {
        private KeywordFeature keywordFeature;
        private DistrictFeature districtFeature;
        private InterestFeature interestFeature;

        private FeatureRelation relation = FeatureRelation.AND;
    }
}
